<script>
	export default {
		onLaunch: function () {
			var arr1 = [{id:2,name:'教育'},{id:1,name:'科创'},{id:3,name:'联盟2324'},{id:4,name:'联盟'},{id:8,name:'联盟'}];
			var arr2 = [{id:1,name:'科创1'},{id:3,name:'联盟'}];
			//做一个函数人会一个数组来处理
			var arr3 = []
			var doarr=function(arr1,arr2){
				arr1.forEach(function(item,index){
					item.toindex = index;
					for(var i=0;i<arr2.length;i++){
						if(item.id == arr2[i].id){
							item.name =arr2[i].name
							break;
						}
					}
				})
				arr2.forEach(function(item,index){
					for(var i=0;i<arr1.length;i++){
						if(item.id == arr1[i].id){
							arr3.push(arr1[i]);
							break;
						}
					}
				})
				var obj = {};
				 arr3 = arr3.reduce(function(item, next) {
				  obj[next.id] ? '' : obj[next.id] = true && item.push(next);
				   return item;
				}, []);
				return arr3
			}
			//console.log(doarr(arr1,arr2))
			
		},
		onShow: function () {
			
			
			//console.log('App Show')
		},
		onHide: function () {
			//console.log('App Hide')
		}
	}
</script>

<style>
	/*每个页面公共css */
	
</style>
